package com.toobigtofail.placeholders
{
	import com.toobigtofail.entities.BuildingBlock;
	import com.toobigtofail.shapes.Box;
	
	import Box2D.Dynamics.b2Body;
	
	import fabulaexmachina.box2fp.Box2DEntity;
	
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Image;
	import net.flashpunk.utils.Draw;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	
	public class PlankPlaceholder extends Placeholder
	{
		[Embed(source="/assets/gfx/plank.png")] private static const PLANK_PNG:Class;
		
		public function PlankPlaceholder(x:Number=0, y:Number=0)
		{
			this.x = x;
			this.y = y;
		
			var img:Image = new Image(PLANK_PNG);
			
			graphic = img;
									
			width = img.width;
			height = img.height;
		}
		
		override public function getBox2DEntity():Box2DEntity {
			return new BuildingBlock(new Box(x + width/2,y + height/2,width/30,height/30, b2Body.b2_dynamicBody),-(graphic as Image).angle);			
		}
	}
}